(global.webpackJsonp = global.webpackJsonp || []).push([ [ "components/sunui-upimg/sunui-upimg" ], {
    "0428": function(e, t, n) {
        n.r(t);
        var a, o = n("85ec"), u = n.n(o);
        for (a in o) "default" !== a && function(e) {
            n.d(t, e, function() {
                return o[e];
            });
        }(a);
        t.default = u.a;
    },
    "752f": function(e, t, n) {},
    "85ec": function(e, n, i) {
        (function(l) {
            Object.defineProperty(n, "__esModule", {
                value: !0
            }), n.default = void 0;
            var e, p = (e = i("4795")) && e.__esModule ? e : {
                default: e
            };
            function a(e) {
                return function(e) {
                    if (Array.isArray(e)) return o(e);
                }(e) || function(e) {
                    if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) return Array.from(e);
                }(e) || function(e, t) {
                    if (e) {
                        if ("string" == typeof e) return o(e, t);
                        var n = Object.prototype.toString.call(e).slice(8, -1);
                        return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(n) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? o(e, t) : void 0;
                    }
                }(e) || function() {
                    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
                }();
            }
            function o(e, t) {
                (null == t || t > e.length) && (t = e.length);
                for (var n = 0, a = new Array(t); n < t; n++) a[n] = e[n];
                return a;
            }
            function c(e, t, n, a, o, u, r) {
                try {
                    var i = e[u](r), c = i.value;
                } catch (e) {
                    return n(e), 0;
                }
                i.done ? t(c) : Promise.resolve(c).then(a, o);
            }
            function s(i) {
                return function() {
                    var e = this, r = arguments;
                    return new Promise(function(t, n) {
                        var a = i.apply(e, r);
                        function o(e) {
                            c(a, t, n, o, u, "next", e);
                        }
                        function u(e) {
                            c(a, t, n, o, u, "throw", e);
                        }
                        o(void 0);
                    });
                };
            }
            var t = {
                data: function() {
                    return {
                        upload_len: 0,
                        upload_cache: [],
                        upload_cache_list: [],
                        upload_before_list: []
                    };
                },
                name: "sunui-upimg",
                props: {
                    url: {
                        type: String,
                        default: ""
                    },
                    upload_img_wh: {
                        type: String,
                        default: "width:162rpx;height:162rpx;"
                    },
                    upload_count: {
                        type: [ Number, String ],
                        default: 9
                    },
                    upload_auto: {
                        type: Boolean,
                        default: !0
                    },
                    upimg_move: {
                        type: Boolean,
                        default: !0
                    },
                    upimg_preview: {
                        type: Array,
                        default: function() {
                            return [];
                        }
                    },
                    upimg_delaytime: {
                        type: [ Number, String ],
                        default: 300
                    },
                    header: {
                        type: Object,
                        default: function() {
                            return {};
                        }
                    }
                },
                created: function() {
                    var t = this;
                    return s(p.default.mark(function e() {
                        return p.default.wrap(function(e) {
                            for (;;) switch (e.prev = e.next) {
                              case 0:
                                setTimeout(function() {
                                    t.upload_before_list = t.upload_before_list.concat(t.upimg_preview), t.upload_len = t.upload_before_list.length, 
                                    t.upimg_preview.map(function(e) {
                                        t.upload_cache_list.push(e.path);
                                    }), t.emit();
                                }, t.upimg_delaytime);

                              case 2:
                              case "end":
                                return e.stop();
                            }
                        }, e);
                    }))();
                },
                methods: {
                    upImage: function(e, t) {
                        var n = this, e = e.map(function(e) {
                            return u(r)({
                                url: "https://" + n.$domain + "/app/index.php?i=" + n.$uniacid + "&c=entry&a=wxapp&do=upload&m=wjyk_recycle",
                                path: e,
                                name: "file",
                                extra: t,
                                _self: n
                            });
                        });
                        l.showLoading({
                            title: "正在上传..."
                        }), Promise.all(e).then(function(e) {
                            var t;
                            l.hideLoading(), (t = n.upload_cache_list).push.apply(t, a(e)), n.emit();
                        }).catch(function(e) {
                            l.hideLoading();
                        });
                    },
                    chooseImage: function() {
                        var a = this;
                        l.chooseImage({
                            count: a.upload_count - a.upload_before_list.length,
                            sizeType: [ "compressed", "original" ],
                            sourceType: [ "album", "camera" ],
                            success: function(e) {
                                for (var t = 0, n = e.tempFiles.length; t < n; t++) e.tempFiles[t].upload_percent = 0, 
                                a.upload_before_list.push(e.tempFiles[t]);
                                a.upload_cache = e.tempFilePaths, a.upload(a.upload_auto);
                            },
                            fail: function(e) {
                                console.log(e);
                            }
                        });
                    },
                    upload: function(n) {
                        var a = this;
                        return s(p.default.mark(function e() {
                            var t;
                            return p.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    if (t = a, n) return e.next = 4, t.upImage(t.upload_cache, t.header);
                                    e.next = 6;
                                    break;

                                  case 4:
                                    e.next = 7;
                                    break;

                                  case 6:
                                    console.warn("传输参数:this.$refs.xx.upload(true)才可上传,默认false");

                                  case 7:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    previewImage: function(e) {
                        for (var t = [], n = 0, a = this.upload_before_list.length; n < a; n++) t.push(this.upload_before_list[n].path);
                        l.previewImage({
                            current: e,
                            urls: t
                        });
                    },
                    removeImage: function(e) {
                        var t = this;
                        t.upload_before_list.splice(e, 1), t.upload_cache_list.splice(e, 1), t.upload_len = t.upload_before_list.length, 
                        t.emit();
                    },
                    emit: function() {
                        this.$emit("change", this.upload_cache_list);
                    }
                }
            };
            n.default = t;
            var u = function(o) {
                return function(n) {
                    for (var e = arguments.length, a = new Array(1 < e ? e - 1 : 0), t = 1; t < e; t++) a[t - 1] = arguments[t];
                    return new Promise(function(e, t) {
                        o.apply(void 0, [ Object.assign({}, n, {
                            success: e,
                            fail: t
                        }) ].concat(a));
                    });
                };
            }, r = function(e) {
                var t, n = e.url, o = e._self, a = e.path, u = e.name, r = e.extra, i = e.success, c = (e.progress, 
                e.fail);
                l.uploadFile({
                    url: n,
                    filePath: a,
                    name: u,
                    formData: r,
                    success: function(e) {
                        var t = e.data;
                        console.warn("sunui-upimg - 如发现没有获取到返回值请到源码191行修改后端返回图片路径以便正常使用插件", t);
                        try {
                            t = e.data;
                        } catch (e) {
                            throw t;
                        }
                        200 == e.statusCode ? i && i(t) : c && c(t);
                    },
                    fail: function(e) {
                        console.log(e), c && c(e);
                    }
                }).onProgressUpdate((t = s(p.default.mark(function e(t) {
                    var n, a;
                    return p.default.wrap(function(e) {
                        for (;;) switch (e.prev = e.next) {
                          case 0:
                            n = 0, a = o.upload_before_list.length;

                          case 1:
                            if (n < a) return e.next = 4, t.progress;
                            e.next = 8;
                            break;

                          case 4:
                            o.upload_before_list[n].upload_percent = e.sent;

                          case 5:
                            n++, e.next = 1;
                            break;

                          case 8:
                            o.upload_before_list = o.upload_before_list, o.upload_len = o.upload_before_list.length;

                          case 10:
                          case "end":
                            return e.stop();
                        }
                    }, e);
                })), function(e) {
                    return t.apply(this, arguments);
                }));
            };
        }).call(this, i("543d").default);
    },
    a61f: function(e, t, n) {
        function a() {
            this.$createElement, this._self._c;
        }
        var o = [];
        n.d(t, "b", function() {
            return a;
        }), n.d(t, "c", function() {
            return o;
        }), n.d(t, "a", function() {});
    },
    b21b: function(e, t, n) {
        n.r(t);
        var a, o = n("a61f"), u = n("0428");
        for (a in u) "default" !== a && function(e) {
            n.d(t, e, function() {
                return u[e];
            });
        }(a);
        n("d18a");
        var r = n("f0c5"), o = Object(r.a)(u.default, o.b, o.c, !1, null, null, null, !1, o.a, void 0);
        t.default = o.exports;
    },
    d18a: function(e, t, n) {
        var a = n("752f");
        n.n(a).a;
    }
} ]), (global.webpackJsonp = global.webpackJsonp || []).push([ "components/sunui-upimg/sunui-upimg-create-component", {
    "components/sunui-upimg/sunui-upimg-create-component": function(e, t, n) {
        n("543d").createComponent(n("b21b"));
    }
}, [ [ "components/sunui-upimg/sunui-upimg-create-component" ] ] ]);